package com.cq.hd.admin.controller;

import com.cq.hd.admin.annotation.RequiresPermissionsDesc;
import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.order.api.TbOrderApi;
import com.cq.hd.order.api.dto.GroupBuyOrderPageDto;
import com.cq.hd.order.api.vo.GroupBuyOrderPageVo;
import com.cq.hd.product.api.vo.LabelPageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "拼团订单相关接口")
@Slf4j
@RestController
@RequestMapping("/groupBuyOrder")
public class GroupBuyOrderController {

    @Resource
    private TbOrderApi orderApi;

    @ApiOperation(value = "拼团团组列表")
    @ApiImplicitParam(name = "groupBuyOrderPageDto", value = "实体", paramType = "query", dataType = "GroupBuyOrderPageDto")
    @ApiResponse(response = GroupBuyOrderPageVo.class, code = 200, message = "接口返回对象参数")
    @RequiresPermissions("operations:groupBuyOrder:list")
    @RequiresPermissionsDesc(menu = {"拼团管理", "拼团团组"}, button = "列表")
    @GetMapping("/pageGroup")
    public Result<Page<GroupBuyOrderPageVo>> pageGroups(GroupBuyOrderPageDto groupBuyOrderPageDto) {
        return orderApi.pageGroupBuyOrders(groupBuyOrderPageDto);
    }


}
